<script>
import { mapMutations } from 'vuex'
import getPixel from '@/util/getPixel'
export default {
  data () {
    return {
      curStyle: {},
      musicInfo: {}
    }
  },
  beforeMount() {
    this.TOGGLE_FOOTER_STATUS(false)
  },
  async mounted() {
    const res = await this.getMusicInfo()
    this.musicInfo = res.data.data[0]
  },
  methods: {
    ...mapMutations('common', ['TOGGLE_FOOTER_STATUS']),
    getMusicInfo () {
      let id = this.$route.params.id
      return this.$axios('/api/song/url?id='+id)
    }
  },
  beforeDestroy() {
    this.TOGGLE_FOOTER_STATUS(true)
  }
}
</script>
<template lang="pug">
.page-player
  .page-player__head
    .iconfont.icon-back
  audio(:src="musicInfo.url")
</template>
<style lang="stylus" scoped>

</style>
